package view;

public class GeometryDescriptor
{
	public GeoState gState;
	
	private int index;
	private int char_index;
	private int controlPoint;

	private boolean moved3;

	public GeometryDescriptor()
	{
		index = -1;
		char_index = -1;
		controlPoint = 0;
		moved3 = false;
	}
	
	public GeometryDescriptor(int index, int char_index)
	{
		this.index = index;
		this.char_index = char_index;
	}
	
	/*
	 * ******************************************
	 * 				Getters & Setters
	 * ******************************************
	 * 
	 */
	
	public int getIndex()
	{
		return index;
	}

	public void setIndex(int index)
	{
		this.index = index;
	}

	public int getCharIndex()
	{
		return char_index;
	}

	public void setCharIndex(int char_index)
	{
		this.char_index = char_index;
	}
	
	public int getControlPoint() {
		return controlPoint;
	}

	public void setControlPoint(int controlPoint) {
		this.controlPoint = controlPoint;
	}
	
	public boolean moved3() 
	{
		return moved3;
	}

	public void setMoved3(boolean moved3) 
	{
		this.moved3 = moved3;
	}
	
	
	public GeoState getGeoState ()
	{
		GeoState tmp;

		if (index != -1 && controlPoint != 0)
			tmp = GeoState.CTRLPT;
		else if (index != -1)
			tmp = GeoState.INSIDE;
		else
			tmp = GeoState.OUTSIDE;

		return tmp;
	}
	
	
	/*
	 * ******************************************
	 * 					Overrides
	 * ******************************************
	 * 
	 */


	@Override
	public String toString()
	{
		String result = "" + index;
		
		if (char_index > -1)
			result = result + " " + char_index;
		
		return result;
	}

	
}
